-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ResponseOps][Connectors] Add support of additional fields for ServiceNow ITSM and SecOps #184023
Conversation
/ci |
Pinging @elastic/response-ops (Team:ResponseOps) |
…nto itsm_additional_fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks pretty good, just some nitpicks. Will test the behaviour tomorrow.
x-pack/plugins/stack_connectors/server/connector_types/lib/validators.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/server/connector_types/lib/servicenow/utils.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/stack_connectors/server/connector_types/lib/servicenow/schema.ts
Show resolved
Hide resolved
we need to store the current state. To match with the data structure define in the backend, we make sure users can't | ||
send the form while not matching the original object structure. */ | ||
subActionParams: ExecutorSubActionPushParamsSIR & { | ||
incident: { additional_fields: string | null }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what type is this? in the schema file it says additional_fields
is a Record<string, any>
, here its a string | null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. The frontend sends a string (JSON.stringify(additional_fields)
) and the backend parses the string converts it to an object and then validates it. The backend will always have a record (object) after the validation. This is happening automatically by the kbn-schema
. This is how all connectors work so far including the webhook connector. An alternative would be to do the parse + validation on the front end and send always a record. Would you like me to do something like that? Any other ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to verify on the UI side, everything is working as expected. The additional field is validated correctly and will disappear when alert triggers on recover.
However I triggers an ITSM action with an alert and was not able to see any incidents. I think it's probably because I configured something incorrectly. I used the information you provided in slack. Let me know if you need more information.
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test change LGTM!
@elasticmachine merge upstream |
…nto itsm_additional_fields
I added a feature flag to accommodate the intermediate release process in Testing
|
@elasticmachine merge upstream |
I tested the above and everything is working as expected. I had an existing Rule(from a previous version of this PR) with ITSM and SecOps actions where
|
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @cnasikas |
…al fields (#186949) ## Summary In #184023, we introduced the "additional fields" field for ServiceNow ITSM and SecOps. The field was under a feature flag to follow the intermediate release process. This PR reverts commit 6a593e9 to remove the feature flag. ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Summary
This PR adds support for additional fields for the ServiceNow ITSM and SecOps connector. The additional fields will not be available to the recovered action.
Testing
Verify that:
Fixes: #183609
Checklist
Delete any items that are not applicable to this PR.
For maintainers
Release notes
Pass any field to ServiceNow using the ServiceNow ITSM and SecOps connectors with a JSON field called "additional fields".